<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link href="css/Yhmain.css" rel="stylesheet" type="text/css"> 
<link rel="stylesheet" href="css/other.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<title>智行校园-精准化服务平台</title>
</head>
<body>
  <input id="the_value" value="消息" style="display:none"/>
    <div class="container" style="min-width:50em;width:100%;height:auto">
    <!--内容-左边容器-->
    	<div class="col-2 leftcol the_lcontainer"></div>
   <!--内容-右边容器-->
        <div class="col-8 bg-color-white" style="min-height:31em">
        		<div class=" pr120 text-left" style="padding-left:1em">
                	<h3 >消息</h3>
                    <!-- <div class="pt10 pb10 float-r">
                        <form>
                            <input class="line-h-32" style="width:23.75em;height:2.0em;"/>
                            <input type="button" class="btn border-rad5 line-h-32" style="width:5.625em;" value="搜索" />
                        </form>
                    </div> -->
                    <div class="mt51 clear-b border-t right-ul">
                    	<ul style="margin:0 0 1em 0"></ul>
                    </div>
                </div>
        </div>
    </div>
    <form method="post"  name="userid_form" >
	    <input type="hidden" value="" name="userid" />
	    <input type="hidden" value="" name="m_type" />
	    <input type="hidden" value="" name="type_name" />
    </form>
<script>
var user_id = '<%=session.getAttribute("userid")%>';
var user_name = '<%=session.getAttribute("username")%>';
var ticket = '<%=session.getAttribute("ticket")%>';
var faceaddress = '<%=session.getAttribute("faceaddress")%>';

  $('input[name=userid]').attr('value',user_id);
   $.getJSON("/WDDXSERVER/message/getMessageFunctionList",{userid:user_id,ticket:ticket},function(data){
	   data = data.content.message;
	   var str='';
	   for(var i=0;i<data.length;i++){
		  
		   str+='<a href="html/personal_center/history_message.jsp"><li><div class="float-l width11 "><div class="right-img"><img src="'+data[i].function_face+'" width="100%" />'+
		   '</div></div><div class="float-l width86 pt5"><span class="in-block mt10 pt10 color-black m_type" data-id="'+data[i].function_id+'">'+data[i].function_name+'</span>';
		   if(data[i].state!='0')
			   /* str+='<span class="color-boder-red color-red" style="font-size:12px;padding:2px;margin-left:0.8em">未读</span>'; */
		   str+= '<span class="in-block float-r pt10 color-black">'+data[i].n_send_time+'</span>'+
		   '<span class="block mt20 color-gary hidden">'+data[i].n_message+'</span></div><div class="clear-b"></div></li></a>';
	   }
	   $('div.right-ul ul').append(str);
	   $('div.right-ul ul a').click(function(){
		   $('form[name=userid_form] input[name=userid]').attr('value',user_id);
		  $('form[name=userid_form] input[name=m_type]').attr('value',$(this).find('span.m_type').attr('data-id'));
		  $('form[name=userid_form] input[name=type_name]').attr('value',$(this).find('span.m_type').text());
		  $('form[name="userid_form"]').attr('action',$(this).attr('href'));
	      $('form[name="userid_form"]').submit();
		  return false;
	   });
   });
</script>
<script type="text/javascript" src="js/header.js"></script>
<script type="text/javascript" src="js/leftcol.js"></script>
</body>
</html>
